import React, {Component} from 'react';
import component from "../../../common/component";
import {Button} from "antd";
import EditModal from "./edit";
import EditAndDelBtn from "@/components/EditAndDelBtn"
import UploadBtn from "@/components/UploadBtn";

class platform extends component {

         //右上角 新建设备类型与删除选中 按钮
        getButtonRow(): null {
            return <>
                <Button className={'button-delete button-default'} onClick={this.handleAdd} type="primary" >
                        新增信息
                </Button>
            </>;
        }
        //主体部分页眉
        getColumns(): null {
            return [
                {
                    title: '设备名称',
                    dataIndex: 'name',
                    key: 'name',
                    width: 150,
                },
                {
                    title: '设备简介',
                    dataIndex: 'text',
                    key: 'text',
                    width: 100,          
                    
                },
                {
                    title: '设备图片',
                    dataIndex: 'image',
                    width: 150,
                    render: (_, record) => {
                        return <UploadBtn  record={record} baseUir={this.state.baseUri}/>
                    },
                   
                },
                {
                    title: '操作',
                    dataIndex: 'operation',
                    fixed: 'right',
                    width: 100,
                    render: (_, record) => {
                        return <EditAndDelBtn record={record} edit={this.edit} del={this.delete}/>
                    },
                }
            ];
        }
    
    
        getEditModal(): null {
            return <EditModal {...this.state.editParam} cancelModal={this.cancelModal} reload={this.reload}
                              baseUir={this.state.baseUri}/>
        }
    }
    
    

export default platform;